/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simulateurs.view.controllersView;

import java.awt.Graphics;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author lunesco
 */
public class WoodPanel extends JPanel {
	public WoodPanel(){super();}

	@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		URL wood=getClass().getResource("wood.jpg");
		ImageIcon icon = new ImageIcon(wood);
		int x = 0;
		int y = 0;
		while (!(x > getSize().width && y > getSize().height)) {
			g.drawImage(icon.getImage(), x, y, this);
			if (x > getSize().width) {
				x = 0;
				y += icon.getIconHeight();
			}
			else x += icon.getIconWidth();
		}
	}
}
